[Top] [Prev] [Next] [Bottom]
[Contents]
SaSetBinEncrypt
Sets the encryption and decryption algorithms used by Sapphire. All state and login information is encrypted/decrypted either with the default Sapphire algorithm or these user defined functions. Sapphire will covert the binary to hex string and back so that a HTML compatible string is used.
#include "SaRnHtml.h"
typedef void* (*SaBinEncrypt) SUTPROTO((void* input, int insize,
int* outsize));
int SaSetBinEncrypt SUTPROTO((SaBinEncrypt encr, SaBinEncrypt
decr));
Arguments
- encr
- Pointer to an encryption function.
- decr
- Pointer to an decryption function.
Return Values
Returns 0 if both inputs are non-NULL or NULL. Returns -1 if either is NULL, but not the other.
Sets the encryption and decryption algorithms used by Sapphire. All state and login information is encrypted/decrypted either with the default Sapphire algorithm or these user defined functions. Functions must be supplied in pairs. If both inputs are NULL, then Sapphire will use the default encryption. Sapphire will covert the binary to hex string and back so that a HTML compatible string is used.
void* MyBadEncryption(void* in, int isize, int* osize)
{
void* ret;
/** isize tells size of input data ***/
/*** must malloc data **/
ret = malloc(isize);
/** "encode" input data ***/
memcpy(ret, in, isize);
/** DO NOT FORGET to set osize variable **/
*osize = isize;
return ret;
}
void* MyBadDecryption(void* in, int isize, int* osize )
{
void* ret;
/** isize tells size of input data ***/
/*** must malloc data **/
ret = malloc(isize);
/** "decode" input data ***/
memcpy(ret, in, isize);
/** DO NOT FORGET to set osize variable **/
*osize = isize;
return ret;
}
SaSetBinEncrypt(MyBadEncryption, MyBadDecryption);
- Note: If you change the encryption, you will also have to change the encryption in the Java client and do matching encryption for the ActiveX control.
See Also
[Top] [Prev] [Next] [Bottom]
[Contents]
info@bluestone.com
Copyright © 1997, Bluestone. All rights
reserved.